<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>fma - OpenGL ES 3.2 Reference Pages</title>
    <link rel="stylesheet" type="text/css" href="opengl-man.css"/>
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"/>
    <script type="text/x-mathjax-config">
            MathJax.Hub.Config({
                MathML: {
                    extensions: ["content-mathml.js"]
                },
                tex2jax: {
                    inlineMath: [['$','$'], ['\\(','\\)']]
                }
            });
        </script>
    <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"/>
  </head>
  <body>
    <header/>
    <div class="refentry" id="fma">
      <div class="titlepage"/>
      <div class="refnamediv">
        <h2>Name</h2>
        <p>fma — perform a fused multiply-add operation</p>
      </div>
      <div class="refsynopsisdiv">
        <h2>Declaration</h2>
        <div class="funcsynopsis">
          <table style="border: 0; cellspacing: 0; cellpadding: 0;" class="funcprototype-table">
            <tr>
              <td>
                <code class="funcdef">genType <strong class="fsfunc">fma</strong>(</code>
              </td>
              <td>genType <var class="pdparam">a</var>, </td>
            </tr>
            <tr>
              <td> </td>
              <td>genType <var class="pdparam">b</var>, </td>
            </tr>
            <tr>
              <td> </td>
              <td>genType <var class="pdparam">c</var><code>)</code>;</td>
            </tr>
          </table>
          <div class="funcprototype-spacer"> </div>
        </div>
      </div>
      <div class="refsect1" id="parameters">
        <h2>Parameters</h2>
        <div class="variablelist">
          <dl class="variablelist">
            <dt>
              <span class="term">
                <em class="parameter">
                  <code>a</code>
                </em>
              </span>
            </dt>
            <dd>
              <p>
                    Specifies the first multiplicand.
                </p>
            </dd>
            <dt>
              <span class="term">
                <em class="parameter">
                  <code>b</code>
                </em>
              </span>
            </dt>
            <dd>
              <p>
                    Specifies the second multiplicand.
                </p>
            </dd>
            <dt>
              <span class="term">
                <em class="parameter">
                  <code>c</code>
                </em>
              </span>
            </dt>
            <dd>
              <p>
                    Specifies the value to be added to the result.
                </p>
            </dd>
          </dl>
        </div>
      </div>
      <div class="refsect1" id="description">
        <h2>Description</h2>
        <p>
            <code class="function">fma</code> performs, where possible, a fused multiply-add operation,
            returning <code class="code">a * b + c</code>.
            In use cases where the return value is eventually consumed by a variable declared as
            <code class="code">precise</code>:
            </p>
        <div class="itemizedlist">
          <ul class="itemizedlist" style="list-style-type: disc; ">
            <li class="listitem">
              <p>
                        <code class="function">fma</code>() is considered a single
                        operation, whereas the expression <code class="code">a * b +
                        c</code> consumed by a variable declared as
                        <code class="code">precise</code> is considered two operations.
                    </p>
            </li>
            <li class="listitem">
              <p>
                        The precision of <code class="function">fma</code>() can
                        differ from the precision of the expression <code class="code">a
                        * b + c</code>.
                    </p>
            </li>
            <li class="listitem">
              <p>
                        <code class="function">fma</code>() will be computed with the
                        same precision as any other
                        <code class="function">fma</code>() consumed by a
                        <code class="code">precise</code> variable, giving invariant
                        results for the same input values of
                        <em class="parameter"><code>a</code></em>, <em class="parameter"><code>b</code></em>
                        and <em class="parameter"><code>c</code></em>.
                    </p>
            </li>
          </ul>
        </div>
        <p>
            Otherwise, in the absense of <code class="code">precise</code> consumption, there are no
            special constraints on the number of operations or difference in precision between
            <code class="function">fma</code>() and the expression <code class="code">a * b + c</code>.
        </p>
      </div>
      <div class="refsect1" id="versions">
        <h2>Version Support</h2>
        <div class="informaltable">
          <table style="border-collapse: collapse; border-top: 2px solid ; border-bottom: 2px solid ; border-left: 2px solid ; border-right: 2px solid ; ">
            <colgroup>
              <col style="text-align: left; "/>
              <col style="text-align: center; " class="firstvers"/>
              <col style="text-align: center; "/>
              <col style="text-align: center; "/>
              <col style="text-align: center; " class="lastvers"/>
            </colgroup>
            <thead>
              <tr>
                <th style="text-align: left; border-right: 2px solid ; ">
                 
            </th>
                <th style="text-align: center; border-bottom: 2px solid ; " colspan="4">
                <span class="bold"><strong>OpenGL ES Shading Language Version</strong></span>
            </th>
              </tr>
              <tr>
                <th style="text-align: left; border-right: 2px solid ; border-bottom: 2px solid ; ">
                <span class="bold"><strong>Function Name</strong></span>
            </th>
                <th style="text-align: center; border-right: 2px solid ; border-bottom: 2px solid ; ">
                <span class="bold"><strong>1.00</strong></span>
            </th>
                <th style="text-align: center; border-right: 2px solid ; border-bottom: 2px solid ; ">
                <span class="bold"><strong>3.00</strong></span>
            </th>
                <th style="text-align: center; border-right: 2px solid ; border-bottom: 2px solid ; ">
                <span class="bold"><strong>3.10</strong></span>
            </th>
                <th style="text-align: center; border-bottom: 2px solid ; ">
                <span class="bold"><strong>3.20</strong></span>
            </th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td style="text-align: left; border-right: 2px solid ; ">
                  <code class="function">fma</code>
                </td>
                <td style="text-align: center; border-right: 2px solid ; ">-</td>
                <td style="text-align: center; border-right: 2px solid ; ">-</td>
                <td style="text-align: center; border-right: 2px solid ; ">-</td>
                <td style="text-align: center; ">✔</td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <div class="refsect1" id="Copyright">
        <h2>Copyright</h2>
        <p>
            Copyright <span class="trademark"/>© 2011-2015 Khronos Group. 
            This material may be distributed subject to the terms and conditions set forth in 
            the Open Publication License, v 1.0, 8 June 1999.
            <a class="link" href="http://opencontent.org/openpub/" target="_top">http://opencontent.org/openpub/</a>.
        </p>
      </div>
    </div>
    <footer/>
  </body>
</html>
